

import java.sql.Time;
import java.sql.Date;

/**
 * This class holds the day and month of an appointment. There are getters and
 * setters to get the date, time, reason, and doctor for the appointment.
 * 
 * @author Matthew Edwards
 * @version 3-5-11
 */
public class Appointment {

	private Date date;

	private Time timeStart, timeEnd;

	private String reason, doctor, patient;
	
	private int ssn;

	/**
	 * This constructor creates the appointment class. 
	 * 
	 * @param ssn
	 *            the Social Security Number of the patient.
	 * @param date
	 *            Takes in a date of type Date
	 */
	public Appointment(int ssn, Date date){
		this.ssn = ssn;
		this.date = date;
	}
	
	/**
	 * This constructor creates the appointment class. It takes in date of type
	 * Date, a start time and end time for the appointment of type Time.
	 * 
	 * @param ssn
	 *            the Social Security Number of the patient.
	 * @param date
	 *            Takes in a date of type Date
	 * @param timeStart
	 *            Takes in a start time of type Time
	 * @param timeEnd
	 *            Takes in an end time of type Time
	 */
	public Appointment(int ssn, Date date, Time timeStart, Time timeEnd) {
		this(ssn, date);
		this.timeStart = timeStart;
		this.timeEnd = timeEnd;
	}

	/**
	 * This constructor overloads the first constructor and takes in a date,
	 * start and end time, and doctor that is treating.
	 * 
	 * @param ssn
	 *            the Social Security Number of the patient.
	 * @param date
	 *            This parameter is of type Date, taken in to set the date of
	 *            the appointment
	 * @param timeStart
	 *            This parameter is of type Time, and is taken in for a start
	 *            time.
	 * @param timeEnd
	 *            This parameter is of type Time, and is taken in for an end
	 *            time.
	 * @param doctor
	 *            This parameter is a string and taken in to set the treating
	 *            doctor.
	 * @param patient
	 *            the patient that will show up to the appointment.
	 */
	public Appointment(int ssn, Date date, Time timeStart, Time timeEnd, String doctor, String patient) {
		this(ssn, date, timeStart, timeEnd);
		this.doctor = doctor;
		this.patient = patient;
	}

	/**
	 * gets the social security number of the patient that will be attending the appointment.
	 * 
	 * @return the social security number of the patient that will be attending the appointment.
	 */
	public int getSSN(){
		return ssn;
	}
	
	/**
	 * sets the social security number of the patient that will be attending the appointment.
	 * 
	 * @param ssn the social security number of the patient that will be attending the appointment.
	 */
	public void setSSN(int ssn){
		this.ssn = ssn;
	}
	
	/**
	 * This getter gets the date of the appointment. It returns it of type date.
	 * 
	 * @return Returns the date of the appointment of type Date.
	 */
	public Date getDate() {
		return date;
	}

	/**
	 * This setter sets the date of the appointment as a type Date.
	 * 
	 * @param date
	 *            Sets the date of the appointment of type Date.
	 */
	public void setDate(Date date) {
		this.date = date;
	}

	/**
	 * This getter gets the start time of the appointment and returns it as a
	 * type Time.
	 * 
	 * @return Returns the start time of the appointment as a type of type Time.
	 */
	public Time getTimeStart() {
		return timeStart;
	}

	/**
	 * This setter sets the start time of the appointment as a type Time.
	 * 
	 * @param timeStart
	 *            Sets the start time of the appointment as a type Time.
	 */
	public void setTimeStart(Time timeStart) {
		this.timeStart = timeStart;
	}

	/**
	 * This getter gets the end time of the appointment and returns it as a type
	 * of Time.
	 * 
	 * @return Returns the end time of the appointment as a type of Time.
	 */
	public Time getTimeEnd() {
		return timeEnd;
	}

	/**
	 * This sets the end time of the appointment as a type of Time.
	 * 
	 * @param timeEnd
	 *            This parameter is of type time and is used to set the end time
	 *            of the appointment.
	 */
	public void setTimeEnd(Time timeEnd) {
		this.timeEnd = timeEnd;
	}

	/**
	 * This getter gets the reason of the appointment and returns it as a type
	 * string.
	 * 
	 * @return Returns the reason of the appointment as a type string.
	 */
	public String getReason() {
		return reason;
	}

	/**
	 * This setter sets the reason of the appointment as a string.
	 * 
	 * @param reason
	 *            This parameter sets the reason of the appointment as a string.
	 */
	public void setReason(String reason) {
		this.reason = reason;
	}

	/**
	 * This getter gets the treating doctor of the appointment time. Returns it
	 * as a type String.
	 * 
	 * @return This returns the treating doctor as a type String.
	 */
	public String getDoctor() {
		return doctor;
	}

	/**
	 * This setter sets the Doctor as a type string for the given appointment.
	 * 
	 * @param doctor
	 *            This parameter is entered as a type String and sets the
	 *            treating doctor.
	 */
	public void setDoctor(String doctor) {
		this.doctor = doctor;
	}

	/**
	 * This getter gets the Patient for the assigned appointment.
	 * 
	 * @return Returns the patient of the given appointment as a type String.
	 */
	public String getPatient() {
		return patient;
	}

	/**
	 * This setter sets the patient as a type String.
	 * 
	 * @param patient
	 *            Thie parameter sets the patient for the given appointment as a
	 *            type String.
	 */
	public void setPatient(String patient) {
		this.patient = patient;
	}

	/**
	 * ex: "Appointment January 1, 2011"
	 * 
	 * @return the appointment and date.
	 */
	public String toString() {
		return "Appointment " + date.toString();
	}

}